package edu.iiitb.gis.vts.action;

import com.opensymphony.xwork2.ActionSupport;

import edu.iiitb.gis.vts.model.VehiclePosition;
import edu.iiitb.gis.vts.service.VehicleService;

public class GetVehiclePosition extends ActionSupport {
	
	private static final long serialVersionUID = -1099464326144194762L;
	
	
	private String vehicleID;
	private String latitude;
	private String longitude;
	private String time;
	
	
	public String execute() {
		System.out.println("Begin getposition");
		VehicleService vehicleService = new VehicleService();
		
		VehiclePosition vehicleposition = vehicleService.getVehiclePosition(vehicleID);
		latitude = vehicleposition.getLatitude();
		longitude = vehicleposition.getLongitude();
		time = vehicleposition.getTime();
		System.out.println(vehicleposition.getVehicleID());
		System.out.println(vehicleposition.getTime());
		System.out.println("getposition called successfully");
		return SUCCESS;
	}

	public void setVehicleID(String vehicleID) {
		this.vehicleID = vehicleID;
	}

	public String getVehicleID() {
		return vehicleID;
	}

	public void setLatitude(String latitude) {
		this.latitude = latitude;
	}

	public String getLatitude() {
		return latitude;
	}

	public void setLongitude(String longitude) {
		this.longitude = longitude;
	}

	public String getLongitude() {
		return longitude;
	}

	public void setTime(String time) {
		this.time = time;
	}

	public String getTime() {
		return time;
	}

	

	
}
